package be.webchess.www.actions;

import be.webchess.www.exceptions.ChessException;
import be.webchess.www.model.User;
import be.webchess.www.service.IUserService;
import be.webchess.www.service.impl.UserService;
import be.webchess.www.utils.MessageDigestHelper;

public class SUserInscriptionAction extends BaseAction {
	
	IUserService us = new UserService(connection);
	User user;
	
	String			login;
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 7126958123961395839L;

	public String execute(){
		
	if(request.getParameter("email") == null){
		
		
	}else{
/*		user = new User();		
		
		
		user.setAccess(1);
		user.setEmail(request.getParameter("email"));
		user.setFirstName(request.getParameter("firstname"));
		user.setFlags(0);
		user.setLastName(request.getParameter("lastname"));
		user.setLogin(request.getParameter("login"));
		user.setPassword( MessageDigestHelper.sha1(request.getParameter("pass")) );
		user.setSecretQuestion(request.getParameter("question"));
		user.setSecretAnswer(request.getParameter("answer"));
		try {
			us.insert(user);
		} catch (ChessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
	}
		
		
			
			
			
			
		
		
		return SUCCESS;
	}
	
	public String		getLogin ()
	{
		return login;
	}
	
	public void		setLogin ( String e )
	{
		login = e;
	}
	

	@Override
	public String getTitle() {
		return "User Inscription";
	}

	@Override
	public String getContent() {
		return "/WEB-INF/jsp/inscription.jsp";
	}

	@Override
	public String getHeadExtra() {
		return "";
	}

	@Override
	public String getErrorTitle() {
		return "Inscription Error";
	}

}
